package com.redis.filter.rebloom;

import io.rebloom.client.ClusterClient;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import redis.clients.jedis.HostAndPort;
import redis.clients.jedis.JedisPoolConfig;

import java.util.HashSet;
import java.util.Set;

/**
 * 分布式
 */
@Configuration
public class ClusterClientConfig {

    @Bean
    public ClusterClient initJedisPool(JedisPoolConfig jedisPoolConfig){
        Set<HostAndPort> jedisClusterNodes = new HashSet<>();
        // 地址集合
        jedisClusterNodes.add(new HostAndPort("192.168.225.135", 6379));
        return new ClusterClient(jedisClusterNodes, 500, 500, 10, "123", jedisPoolConfig);
    }
}
